package com.zac.coroutine.algorithm.leetcode.strings

/**
 * author zac
 * date 2025/8/7
 *
 */
object IsSubsequence {
    @JvmStatic
    fun main(args: Array<String>) {
        print(isSubsequence("acb", "ahbgdc"))
    }

    fun isSubsequence(s: String, t: String): Boolean {
        var start = 0
        outer@ for (i in 0 until s.length) {
            inner@ for (j in start until t.length) {
                if (s[i] == t[j]) {
                    start = j + 1
                    continue@outer
                }
            }
            return false
        }
        return true
    }


}